/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.open.api.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeEntity;
import info.peigen.hotpot.component.open.api.facade.enums.ApiStatus;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

/**
 * <b>(OpenApiLogEntity)</b>
 * OpenApi记录表
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/1
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "open_api_log", comment = "OpenApi记录表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "open_api_log")
public class OpenApiLogEntity extends AbstractCreateTimeEntity {
    @Column(name = "api_log_id", type = MySqlTypeConstant.VARCHAR, length = 30, comment = "apiLogId")
    @Unique(value = "apiLogId", columns = "api_log_id")
    @org.beetl.sql.annotation.entity.Column("api_log_id")
    String    apiLogId;
    @Column(name = "gid", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "gid")
    @Unique(value = "gid", columns = "gid")
    @org.beetl.sql.annotation.entity.Column("gid")
    String    gid;
    @Column(name = "request_no", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "requestNo")
    @Unique(value = "requestNo", columns = "request_no")
    @org.beetl.sql.annotation.entity.Column("request_no")
    String    requestNo;
    @Column(name = "status", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false,
            comment = "状态;Init:初始化,Unique:唯一性验证,Cert:接口可用验证,Done_Sync:接口同步调用完成,Done_Notify:接口异步通知完成")
    @Index(value = "status", columns = "status")
    @org.beetl.sql.annotation.entity.Column("status")
    ApiStatus status;
    @Column(name = "api_code", type = MySqlTypeConstant.VARCHAR, length = 300, comment = "apiCode")
    @Index(value = "apiCode", columns = "api_code")
    @org.beetl.sql.annotation.entity.Column("api_code")
    String    apiCode;
    @Column(name = "encrypt", type = MySqlTypeConstant.TEXT, comment = "加密串")
    @org.beetl.sql.annotation.entity.Column("encrypt")
    String    encrypt;
    @Column(name = "decrypt", type = MySqlTypeConstant.JSON, comment = "解密后的JSON串")
    @org.beetl.sql.annotation.entity.Column("decrypt")
    String    decrypt;
    @Column(name = "user_ip", type = MySqlTypeConstant.VARCHAR, length = 20, comment = "客户浏览器 IP")
    @org.beetl.sql.annotation.entity.Column("user_ip")
    String    userIp;
    @Column(name = "version", type = MySqlTypeConstant.VARCHAR, length = 20, comment = "version")
    @org.beetl.sql.annotation.entity.Column("version")
    String    version;
}